import React, { PureComponent } from 'react';

export default class extends PureComponent {

  handleStandardTableChange = (pagination, filtersArg, sorter) => {
    const { dispatch } = this.props;
    const { formValues } = this.state;

    const filters = Object.keys(filtersArg).reduce((obj, key) => {
      const newObj = { ...obj };
      newObj[key] = getValue(filtersArg[key]);
      return newObj;
    }, {});

    const params = {
      from: pagination.current,
      size: pagination.pageSize,
      ...formValues,
      ...filters,
    };
    if (sorter.field) {
      params.sorter = `${sorter.field}_${sorter.order}`;
    }

    dispatch({
      type: 'apply/fetch',
      payload: params,
    });
  };

  handleTabChange = namespace => {
    const { dispatch, ...aaa } = this.props;

    console.log(aaa, 123)

    dispatch({
      type: 'recoveries/fetch',
      payload: { namespace },
    });
  }
}